package com.itheima.pojo;

public class Result {
    // 1 返回的响应码: 1成功 0失败
    private Integer code;
    // 2 响应码的描述
    private String msg;
    // 3 封装响应数据
    private Object Data;

    public Result() {
    }

    public Result(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        Data = data;
    }

    public static Result success(Object data) {
        return new Result(1, "success", data);
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return Data;
    }

    public void setData(Object data) {
        Data = data;
    }

    @Override
    public String toString() {
        return "Result{" + "code=" + code + ", msg='" + msg + '\'' + ", Data=" + Data + '}';
    }
}
